﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Sites/Man/Main.master" AutoEventWireup="true"
    CodeFile="Create.aspx.cs" Inherits="Templates_ActionPlan_Create" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="Server">

    <script type="text/javascript">
        $(document).ready
        (
            function() {
                $("ul.middle > li.selected > ul.apNested > li > div > label").hover(
                    function() {
                        if (this.recommendation) {
                            $("#<%= lblPledgeRecommendation.ClientID%>").text(this.recommendation);
                        }
                        if (this.saving) {
                            $("#<%= lblPledgeSaving.ClientID%>").html(this.saving);
                        }
                    },
                    function() { }
                );
            }
        );
    </script>

    <cex:RoundedBox ID="titleBox" Color="White" RoundedBottom="false" runat="server">
        <h2>My Action Plan</h2>
    </cex:RoundedBox>
    <div class="spacer" style="border-top: 3px solid #c2bcb6; background-color: #ffffff">
    </div>
    
    <cex:RoundedBox ID="content" Color="White" RoundedTop="false" runat="server">
        
        <asp:Panel ID="pnlNoAudit" Visible="false" runat="server">
            <div style="padding:10px;">
                <ul class="col first">
                    <li>
                        <p>No data available yet, please <asp:HyperLink ID="lnkActionPlan" Text="complete an audit first" runat="server" />.</p>
                    </li>
                </ul>
            </div>

        </asp:Panel>
        
        <asp:Panel ID="pnlActionPlan" CssClass="actionPlan" DefaultButton="btnSubmit" runat="server">
            <div class="predictedStats">
                Your Household Audit 
                <asp:Label ID="lblAuditDate" runat="server" CssClass="date" Text="2008/2009" /> :
                <asp:Label ID="lblAuditPrediction" CssClass="stats" runat="server" Text="00.00KG CO<sub>2</sub>e / $00.00" />
            </div>
            <div class="solutionSelection">
                <telerik:RadSlider ID="slider" runat="server" Width="700" Height="30" ItemType="Item"
                    TrackPosition="TopLeft" TrackMouseWheel="false"  AutoPostBack="true" ShowDecreaseHandle="false" ShowIncreaseHandle="false"
                    ShowDragHandle="true" Value="1" MinimumValue="0" MaximumValue="2" OnValueChanged="slider_ValueChanged">
                    <Items>
                        <telerik:RadSliderItem Text="Technological Solutions" Value="0"/>
                        <telerik:RadSliderItem Text="All Solutions" Value="1"/>
                        <telerik:RadSliderItem Text="Behavioural Solutions" Value="2"/>
                    </Items>
                </telerik:RadSlider>
            </div>
            <div class="colA">
                <asp:ListView ID="listSections" DataSourceID="dsSections" DataKeyNames="Id" SelectedIndex="0"
                    runat="server">
                    <LayoutTemplate>
                        <ul class="col first">
                            <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                        </ul>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <li>
                            <div class="holder clearfix">
                                <asp:LinkButton ID="lnkTitle" Text='<%#Eval("Name")%>' CommandName="Select" CssClass="apTitle"
                                    runat="server" />
                            </div>
                            <asp:ListView ID="listPending" OnDataBinding="listPending_DataBinding" runat="server" >
                                <LayoutTemplate>
                                    <ul class="clearfix">
                                        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                                    </ul>
                                    
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <li>
                                        <asp:Label id="lblPledgText" Text='<%#Eval("PledgeName") %>' runat="server" />
                                        <asp:Label id="Label1" class="apRightInfo" Text='<%#Eval("AveSavingPerMonth", "{0:0.## kg CO<sub>2</sub>e}") %>' runat="server" />
                                    </li>
                                </ItemTemplate>
                            </asp:ListView>
                        </li>
                    </ItemTemplate>
                    <SelectedItemTemplate>
                        <li class="selected clearfix">
                            <div class="holder clearfix">
                                <asp:Label ID="lblTitle" Text='<%#Eval("Name")%>' CssClass="apTitle" runat="server" />
                            </div>
                            <asp:ListView ID="listPending" OnDataBinding="listPending_DataBinding" runat="server" >
                                <LayoutTemplate>
                                    <ul>
                                        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                                    </ul>
                                    <div class="clear">
                                    </div>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <li>
                                        <asp:Label id="lblPledgText" CssClass="apLeftSelectedItem" Text='<%#Eval("PledgeName") %>' runat="server" />:
                                        <asp:Label id="Label1" class="apRightInfo" Text='<%#Eval("AveSavingPerMonth", "{0:0.## kg CO<sub>2</sub>e}") %>' runat="server" />
                                    </li>
                                </ItemTemplate>
                            </asp:ListView>
                        </li>
                    </SelectedItemTemplate>
                </asp:ListView>
                <asp:ListView ID="listCategories" DataSourceID="dsCategories" DataKeyNames="Id" SelectedIndex="0"
                    runat="server">
                    <LayoutTemplate>
                        <ul class="col middle">
                            <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                        </ul>
                    </LayoutTemplate>
                    <EmptyDataTemplate>
                        <ul class="col middle">
                            <li>No Pledge Categories</li>
                        </ul>
                    </EmptyDataTemplate>
                    <ItemTemplate>
                        <li>
                            <div class="holder clearfix">
                                <asp:LinkButton ID="lblCategoryName" Text='<%# Eval("Name") %>' CssClass="apTitle" CommandName="Select" runat="server" />
                                <acms:InfoPopUp ID="info" CssClass="infoPopUp" Text='<%#Eval("Info") %>'  runat="server" />
                            </div>
                        </li>
                    </ItemTemplate>
                    <SelectedItemTemplate>
                        <li class="selected clearfix">
                            <div class="holder">
                                <asp:Label ID="lblCategoryName" Text='<%# Eval("Name") %>' CssClass="apTitle" runat="server" />
                                <acms:InfoPopUp ID="info" CssClass="infoPopUp" Text='<%#Eval("Info") %>'  runat="server" />
                                <div class="clear">
                                </div>
                            </div>
                            <asp:ListView ID="listPledges" DataKeyNames="Id" OnItemDataBound="listPledges_ItemDataBound" runat="server">
                                <LayoutTemplate>
                                    <ul class="apNested">
                                        <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                                    </ul>
                                </LayoutTemplate>   
                                <EmptyDataTemplate>
                                    <ul class="apNested">
                                        <li>
                                            No Pledges for this category with this type.
                                        </li>
                                    </ul>
                                </EmptyDataTemplate>
                                <ItemTemplate>
                                    <li>
                                        <div class="holder">
                                            <asp:Label ID="lblPledgeName" AssociatedControlID="cboPledge" Text='<%#Eval("Name") %>' CssClass="apTitle" runat="server" />
                                            <span class="apRightInfo">
                                                <asp:CheckBox ID="cboPledge" OnDataBinding="cboPledge_DataBinding" OnCheckedChanged="cboPledge_CheckChanged" AutoPostBack="true" runat="server" />
                                            </span>
                                            <div class="clear">
                                            </div>
                                        </div>
                                    </li>
                                </ItemTemplate>
                            </asp:ListView>
                        </li>
                    </SelectedItemTemplate>
                </asp:ListView>
                <ul class="col last">
                    <li class="formItem">
                        <asp:Label ID="lblPledgeRecommendation" runat="server" />
                    </li>
                    <li>POTENTIAL SAVING<br />
                        <asp:Label ID="lblPledgeSaving" CssClass="data" runat="server" Text="0.00 kg CO<sub>2</sub>e" />
                    </li>
                    <%--<li>» Useful websites </li>--%>
                </ul>
                <div class="clear">
                </div>
                <hr />
            </div>
            <div class="colA">
                <ul class="col first">
                    <li style="background:#E1F4FD; border-bottom:0px">
                            <div class="holder clearfix">
                                <asp:Label ID="Label16" Font-Bold="true" Text="Predicted Household Saving" CssClass="" runat="server" />:
                                <asp:Label ID="lblPredictedSaving" Text="y" CssClass="" runat="server" />
                            </div>
                            <%--<div class="holder clearfix">
                                <asp:Label ID="Label14" Font-Bold="true" Text="Outstanding CO2" CssClass="" runat="server" />:
                                <asp:Label ID="lblOutstandingCO2" Text="x" CssClass="" runat="server" />
                            </div>
                            <div class="holder">
                                <asp:Label ID="Label18" Text="Outstanding CO2" CssClass="apTitle" runat="server" />
                                <asp:Label ID="Label19" Text="???" CssClass="apRightInfo" runat="server" />
                                <div class="clear">
                                </div>
                            </div>--%>
                   
                    </li>
                </ul>
                <ul class="col middle">
                    <li style="border-bottom:0px">
                        <div class="buttons">
                            <asp:Panel ID="pnlGeneralError" CssClass="validationError" EnableViewState="false"
                                Visible="false" runat="server">
                                <ul id="ulGeneralErrors" runat="server">
                                </ul>
                            </asp:Panel>
                            <asp:Button ID="btnSubmit" Text="Create Your Commitments" OnClick="btnSubmit_Click" OnClientClick="Are you sure you are ready to create your commitment?" runat="server" />
                        </div>
                    </li>
                </ul>
                <ul class="col last">
                    <li style="border-bottom:0px">
                        <%--<asp:Hyperlink NavergateUrl="'<%#AcmsContext.ResolveUrl'%>/MyCO2/MyCommitments.aspx" Text="View your Commitments" runat="server" />--%>
                        
                        <a href='<%#ResolveUrl(AcmsContext.GetUrl("~/MyCO2/MyCommitments.aspx"))%>'>View My Commitments</a>
                    </li>
                </ul>
                <div class="clear">
                </div>
            </div>
        <hr />
        </asp:Panel>
        
    </cex:RoundedBox>
    <acms:EventDrivenDataSource ID="dsSections" runat="server" />
    <acms:EventDrivenDataSource ID="dsCategories" runat="server" />

</asp:Content>
